package FlyweightOne;

import java.util.ArrayList;
import java.util.List;

public class Client {

	public static void main(String[] args) {
		List<Character> list = new ArrayList<Character>();
		list.add('a');
		list.add('b');
		list.add('c');
		list.add('a');
		list.add('b');
		
		FlyweightFactory factory = new FlyweightFactory();
		Flyweight a = factory.factory(list);
		Flyweight b = factory.factory(list);
		a.operation("1223123s");
		
		System.out.println(a == b);
		
		Character zz = 'a';
		Flyweight c = factory.factory(zz);
		Flyweight d = factory.factory(zz);
		c.operation("zzzzzzzzzz");
		System.out.println(c == d);
	}
}
